home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet multimedia / Animacje, filmy i prezentacje / Odtwarzacze filmow / JahPlayer 0.1.0 / jahplayer-0.1.0-installer.exe / openlibraries-0.3.0-runtime.exe / shaders / histogram.frag < prev    next >
Text File  |  2006-07-29  |  526b  |  25 lines

  1.  
  2. // fx - A compositing library representation.
  3.  
  4. // Copyright (C) 2005-2006 Visual Media FX Ltd.
  5. // Released under the LGPL.
  6. // For more information, see http://www.openlibraries.org.
  7.  
  8. uniform sampler2D inColor0;
  9. uniform float min;
  10. uniform float max;
  11. uniform vec4 channels;
  12.  
  13. varying vec2 v_tex;
  14.  
  15. void main( void )
  16. {
  17.     vec4 color = texture2D( inColor0, v_tex );
  18.     
  19.     float level = clamp( dot( channels, color ), 0.0, 1.0 ) * color.a;
  20.     if( level < min || level >= max )
  21.         discard;
  22.     
  23.     gl_FragColor = color;
  24. }
  25.